Optimal. Leaf size=33 \[ \frac{2 \tan (c+d x)}{a d (a \sec (c+d x)+a)}-\frac{x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.111743, antiderivative size = 35, normalized size of antiderivative = 1.06, number of steps used = 9, number of rules used = 6, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.286, Rules used = {3888, 3886, 3473, 8, 2606, 3767} \[ -\frac{2 \cot (c+d x)}{a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}-\frac{x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3888
Rule 3886
Rule 3473
Rule 8
Rule 2606
Rule 3767
Rubi steps
\begin{align*} \int \frac{\tan ^2(c+d x)}{(a+a \sec (c+d x))^2} \, dx &=\frac{\int \cot ^2(c+d x) (-a+a \sec (c+d x))^2 \, dx}{a^4}\\ &=\frac{\int \left (a^2 \cot ^2(c+d x)-2 a^2 \cot (c+d x) \csc (c+d x)+a^2 \csc ^2(c+d x)\right ) \, dx}{a^4}\\ &=\frac{\int \cot ^2(c+d x) \, dx}{a^2}+\frac{\int \csc ^2(c+d x) \, dx}{a^2}-\frac{2 \int \cot (c+d x) \csc (c+d x) \, dx}{a^2}\\ &=-\frac{\cot (c+d x)}{a^2 d}-\frac{\int 1 \, dx}{a^2}-\frac{\operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}+\frac{2 \operatorname{Subst}(\int 1 \, dx,x,\csc (c+d x))}{a^2 d}\\ &=-\frac{x}{a^2}-\frac{2 \cot (c+d x)}{a^2 d}+\frac{2 \csc (c+d x)}{a^2 d}\\ \end{align*}
Mathematica [A] time = 0.0218923, size = 42, normalized size = 1.27 \[ \frac{\frac{2 \tan \left (\frac{c}{2}+\frac{d x}{2}\right )}{d}-\frac{2 \tan ^{-1}\left (\tan \left (\frac{c}{2}+\frac{d x}{2}\right )\right )}{d}}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.069, size = 37, normalized size = 1.1 \begin{align*} 2\,{\frac{\tan \left ( 1/2\,dx+c/2 \right ) }{d{a}^{2}}}-2\,{\frac{\arctan \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.76568, size = 66, normalized size = 2. \begin{align*} -\frac{2 \,{\left (\frac{\arctan \left (\frac{\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a^{2}} - \frac{\sin \left (d x + c\right )}{a^{2}{\left (\cos \left (d x + c\right ) + 1\right )}}\right )}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.12642, size = 99, normalized size = 3. \begin{align*} -\frac{d x \cos \left (d x + c\right ) + d x - 2 \, \sin \left (d x + c\right )}{a^{2} d \cos \left (d x + c\right ) + a^{2} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tan ^{2}{\left (c + d x \right )}}{\sec ^{2}{\left (c + d x \right )} + 2 \sec{\left (c + d x \right )} + 1}\, dx}{a^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.51605, size = 39, normalized size = 1.18 \begin{align*} -\frac{\frac{d x + c}{a^{2}} - \frac{2 \, \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )}{a^{2}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]